package com.laosg.study.base.ch5

/**
  * Created by kaimin on 13/5/2019.
  * time : 16:29
  */
object Implicittest {

  def main(args: Array[String]): Unit = {
    implicit val name:String="Jack" //隐式值



    implicit def con(s:Double):Int = {
      s.toInt
    }
    val a:Int=3.6

    println(a)
    ts

    def ts(implicit name:String): Unit ={
      println("hello"+name)
    }


    implicit class DB1(val m:MySqlxx){
      def add():String={
        m+" scala"
      }
    }


    val mySql = new MySqlxx
    mySql.say()
    mySql.add()


  }


}


class MySqlxx{
  def say(): Unit ={
    println("mysql OK")
  }
}
